package clue

type AddClueSourceFollowRecordRequest struct {
	ContactName     string `json:"contact_name"`
	ContactTel      string `json:"contact_tel"`
	ClueStatus      int32  `json:"clue_status"`
	CustomerName    string `json:"customer_name"`
	OrganizingCode  string `json:"organizing_code"`
	ClueSourceId    string `json:"clue_source_id"`
	ClueSourceTitle string `json:"clue_source_title"`
	ClueDetail      string `json:"clue_detail"`
	ClueSource      string `json:"clue_source"`
	FollowType      int32  `json:"follow_type"`
	FollowStatus    string `json:"follow_status"`
	FollowContent   string `json:"follow_content"`
	CustomerType    string `json:"customer_type"`
	FromDevice      string `json:"from_device"`
}

type AddCustomersRequest struct {
	Customers         []*CustomerItem `json:"customers"`
	UserGuid          string          `json:"user_guid"`
	UserName          string          `json:"user_name"`
	CooperationStatus int32           `json:"cooperation_status"`
	Action            string          `json:"action"`
}

type CustomerItem struct {
	CustomerName   string `json:"customer_name"`
	OrganizingCode string `json:"organizing_code"`
	CityCode       string `json:"city_code"`
	ProvinceCode   string `json:"province_code"`
	City           string `json:"city"`
	Province       string `json:"province"`
}

type SaveClueRequest struct {
	Id              int64  `json:"id" binding:"min=0"`
	ContactName     string `json:"contact_name" binding:"max=60" err:"联系人姓名长度不能超过60字"`
	ContactMobile   string `json:"contact_mobile" binding:"required_without=Id,max=30" err:"联系人手机号长度不能超过30字"`
	ContactPosition string `json:"contact_position" binding:"max=30" err:"联系人职位长度不能超过60字"`
	CompanyName     string `json:"company_name" binding:"required,max=200" err:"公司名称长度不能超过200字"`
	OrganizingCode  string `json:"organizing_code" binding:"max=100" err:"社会信用代码长度不能超过100字"`
	ProvinceCode    string `json:"province_code" binding:"required_without=Id,max=16" err:"线索地区不能为空"`
	CityCode        string `json:"city_code" binding:"max=16" err:"城市地区参数错误"`
	Status          int32  `json:"status" binding:"oneof=0 1 2 3 4 5" err:"线索状态参数错误"`
	InChargeUserId  int64  `json:"in_charge_user_id" binding:"required_without=Id,min=0"`
}

type DeleteClueRequest struct {
	Id int64 `json:"id" form:"id" binding:"required" err:"线索id不能为空"`
}

type GetClueListRequest struct {
	Keyword   string   `json:"keyword" form:"keyword"`
	UseCase   int32    `json:"use_case" form:"use_case" binding:"oneof=1 2 3"`
	Status    []int32  `json:"status" form:"status"`
	AreaCodes []string `json:"area_codes" form:"area_codes"`
	Page      int32    `json:"page" form:"page" binding:"min=0" err:"页码参数错误"`
	PageSize  int32    `json:"page_size" form:"page_size" binding:"min=0" err:"页大小参数错误"`
	// 当use_case为3时，一下两个参数必填
	InChargeUserIds []int64 `json:"in_charge_user_ids" form:"in_charge_user_ids"`
	Assigned        int32   `json:"assigned" form:"assigned"`
}

type ExportClueListRequest struct {
	Keyword   string   `json:"keyword" form:"keyword"`
	UseCase   int32    `json:"use_case" form:"use_case" binding:"oneof=1 2 3"`
	Status    []int32  `json:"status" form:"status"`
	AreaCodes []string `json:"area_codes" form:"area_codes"`
	//IdList    []int64  `json:"id_list"`
	// 当use_case为3时，一下两个参数必填
	InChargeUserIds []int64 `json:"in_charge_user_ids" form:"in_charge_user_ids"`
	Assigned        int32   `json:"assigned" form:"assigned"`
}

type GetClueDetailByIdRequest struct {
	Id int64 `json:"id" form:"id" binding:"required" err:"线索id不能为空"`
}

type SaveClueTrackerRequest struct {
	ClueId int64 `json:"clue_id" binding:"required" err:"线索id不能为空"`
	UserId int64 `json:"user_id" binding:"required" err:"跟进人用户id不能为空"`
}

type GetClueTrackerListRequest struct {
	ClueId   int64 `json:"clue_id" form:"clue_id" binding:"required" err:"线索id不能为空"`
	Page     int32 `json:"page" form:"page" binding:"min=0" err:"页码参数错误"`
	PageSize int32 `json:"page_size" form:"page_size" binding:"min=0" err:"页大小参数错误"`
}

type DeleteClueTrackerRequest struct {
	Id int64 `json:"id" binding:"required" err:"参数错误，id不能为空"`
}

type ReplaceChargeUserRequest struct {
	ClueId int64 `json:"clue_id" binding:"required" err:"线索id不能为空"`
	UserId int64 `json:"user_id" binding:"required" err:"跟进人用户id不能为空"`
}

type SaveClueContactRequest struct {
	Id          int64  `json:"id"`
	ClueId      int64  `json:"clue_id" form:"clue_id" binding:"required" err:"线索id不能为空"`
	Name        string `json:"name" form:"name" binding:"required,max=60" err:"联系人姓名不能为空"`
	CompanyName string `json:"company_name" form:"company_name" binding:"required,max=200" err:"公司名称不能为空"`
	Position    string `json:"position" form:"position" binding:"max=60" err:"联系人职位长度不能超过60个字"`
	Mobile      string `json:"mobile" form:"mobile" binding:"required,max=30" err:"联系方式不能为空"`
}

type DeleteClueContactRequest struct {
	Id int64 `json:"id" binding:"required" err:"参数错误，id不能为空"`
}

type GetClueContactListRequest struct {
	ClueId   int64 `json:"clue_id" form:"clue_id" binding:"required" err:"线索id不能为空"`
	Page     int32 `json:"page" form:"page" binding:"min=0" err:"页码参数错误"`
	PageSize int32 `json:"page_size" form:"page_size" binding:"min=0" err:"页大小参数错误"`
}

type AddClueFollowRecordRequest struct {
	ClueId     int64  `json:"clue_id" binding:"required" err:"线索id不能为空"`
	FollowType int32  `json:"follow_type" binding:"oneof=1 2 3 4 5" err:"跟进类型参数错误"`
	ClueStatus int32  `json:"clue_status" binding:"oneof=1 2 3 4 5" err:"跟进状态参数错误"`
	ContactId  int64  `json:"contact_id"`
	Content    string `json:"content" binding:"required" err:"跟进记录不能为空"`
}

type GetClueFollowRecordListRequest struct {
	ClueId   int64 `json:"clue_id" form:"clue_id" binding:"required" err:"线索id不能为空"`
	Page     int32 `json:"page" form:"page"`
	PageSize int32 `json:"page_size" form:"page_size"`
}

type GetClueContactDetailByIdRequest struct {
	Id int64 `json:"id" form:"id" binding:"required" err:"id不能为空"`
}

type AddClueSourceFollowRequest struct {
	FollowType      int32  `json:"follow_type" binding:"oneof=1 2 3 4" err:"跟进类型参数错误"`
	ClueStatus      int32  `json:"clue_status" binding:"oneof=1 2 3 4 5" err:"线索类型错误"`
	Content         string `json:"content"`
	FollowStatus    string `json:"follow_status" binding:"max=40" err:"联系状态参数错误"`
	ContactName     string `json:"contact_name" binding:"max=60" err:"联系人姓名长度不能超过60字"`
	ContactMobile   string `json:"contact_mobile" binding:"required,max=30" err:"联系人手机号长度不能超过30字"`
	ContactPosition string `json:"contact_position" binding:"max=30" err:"联系人职位长度不能超过60字"`
	OrganizingCode  string `json:"organizing_code" binding:"max=100" err:"社会信用代码长度不能超过100字"`
	CompanyName     string `json:"company_name" binding:"max=200" err:"公司名称长度不能超过200字"`
	Source          int32  `json:"source" binding:"oneof=1 2 3 4 5 6 7" err:"线索来源参数错误"`
	SourceId        string `json:"source_id" binding:"max=100" err:"线索来源id长度不能超过100个字"`
	SourceTitle     string `json:"source_title" binding:"max=500" err:"线索来源id长度不能超过500个字"`
	ProvinceCode    string `json:"province_code"`
	CityCode        string `json:"city_code"`
}
